// 联系管理员——路由页面
import React from 'react'
import './Administrator.scss'
import logo from '../../assets/image/logo.jpg'
import axios from 'axios';
// 图标
import {RocketIcon} from '@primer/octicons-react';
export default class Administrator extends React.Component {
    constructor(props){
        super(props)
        this.state={
            managerInfo:
                [{adminName:"张三",adminID:1,positions:"战士",province:"贵州",city:"贵阳",tel:'18888888888'}]
            
        }
      }
      componentDidMount() {
        //   获取远端数据
       axios(`/store-manage/gw1901/store_manager_info.php`).then(res =>{
           this.setState({
            managerInfo:res.data
           })
       })
        }
        
    render() {
        return (
            <div className="Administrator">
                <h2><RocketIcon size={36} />联系管理员</h2>
                {/* 每个管理员信息*/}
                {this.state.managerInfo.map( info =>(
                    <div className="administrator" key={info.adminID}>
                    {/* 管理员姓名 */}
                    <h3> {info.adminName} </h3>
                    <div className="info">
                        {/* 头像 */}
                        <img src={logo} alt=""/>
                        {/* 基本信息 */}
                        <div>
                            <p>职位：{info.positions}</p>
                            <p>管理地区：{info.province}-{info.city}</p>
                            <p>手机号：{info.tel}</p>
                        </div>
                            
                    </div>
                </div>
                ))}
                
            </div>
        )
    }
}
